export function createRect(pointer) {
    return new fabric.Rect({
        left: pointer.x - 50,
        top: pointer.y - 40,
        fill: '#f4f4f4',
        stroke: '#000000',
        strokeWidth: 1,
        width: 100,
        height: 80,
        selectable: true,
        hasControls: true,
        hasBorders: true
    })
}

export function createCircle(pointer) {
    return new fabric.Circle({
        left: pointer.x - 25,
        top: pointer.y - 25,
        fill: '#f4f4f4',
        stroke: '#000000',
        strokeWidth: 1,
        radius: 25,
        selectable: true,
        hasControls: true,
        hasBorders: true
    })
}

export function createText(pointer) {
    return new fabric.IText('双击编辑文字', {
        left: pointer.x,
        top: pointer.y,
        fontSize: 20,
        fill: '#000',
        editable: true
    })
}

export function createLine(pointer) {
    return new fabric.Line([pointer.x, pointer.y, pointer.x, pointer.y], {
        stroke: '#000000',
        strokeWidth: 1,
        selectable: true,
        hasBorders: true,
        hasControls: true,
        zIndex: 1
    })
}

